<template>
  <div>
    <nav-top></nav-top>
    <el-container>
      <el-aside width="200px">
        <nav-left :navlist="navlist"></nav-left>
      </el-aside>
      <el-container>
        <el-header><swiper :swiperlist="swiperlist"></swiper></el-header>
        <el-main><list :goodslist="goodslist"></list></el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import NavTop from "../../components/NavTop.vue";
import List from "./components/List.vue";
import NavLeft from "./components/NavLeft.vue";
import Swiper from "./components/Swiper.vue";
export default {
  components: { NavTop, NavLeft, Swiper, List },
  name: "Home",
  data() {
    return {
      navlist: [],
      swiperlist: [],
      goodslist: [],
      list:[]
    };
  },
  methods(){
    console.log
  },
  mounted() {
    this.$axios.get("http://mock-api.com/VKywG3gw.mock/navlist").then((res) => {
      this.navlist = res.data.navlist;
    });
    //
    //
    this.$axios.get("http://mock-api.com/VKywG3gw.mock/swiperlist").then((res) => {
        this.swiperlist = res.data.swiperlist;
      });
      //
      //
    //http://mock-api.com/RzJx6rn9.mock/goods
    //http://mock-api.com/lKGQJDgA.mock/goods
    this.$axios.get("http://mock-api.com/lKGQJDgA.mock/goods").then((res) => {
      this.goodslist = res.data.goodslist;
      console.log(this.goodslist);
      this.list=this.goodslist
    });
  },
};
</script>

<style scoped>
.el-header {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  height: 300px !important;
  padding: 0;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
}
</style>
